package com.xuanyang.dormrepair.model.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author 用户
 */
@Data
@Accessors(chain = true)
@TableName("user")
public class User {

    @TableId
    private Integer id;

    @TableField(strategy = FieldStrategy.NOT_EMPTY)
    private String username;

    @TableField(strategy = FieldStrategy.NOT_EMPTY)
    private String password;

    @TableField(strategy = FieldStrategy.NOT_EMPTY)
    private String name;

    private Integer status;

    /**
     * 电话
     */
    private String tel;

    /**
     * 角色
     */
    private Integer role;

    /**
     * 最后登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date loginTime;
}